﻿@using Blogifier.Core
@{
    var request = Url.ActionContext.HttpContext.Request;
    var absoluteUrl = $"{request.Scheme}://{request.Host.ToUriComponent()}{request.PathBase.ToUriComponent()}";

    if (Model.ToString().EndsWith("PostModel"))
    {
        PostModel postModel = (PostModel)Model;
    <title>@postModel.Post.Title &amp; @postModel.Blog.Title</title>
    <meta name="author" content="@postModel.Post.Author.DisplayName">
    <meta name="description" content="@postModel.Post.Description.StripHtml()">
    <link rel="canonical" href="@absoluteUrl/posts/@postModel.Post.Slug" />
    }
    else
    {
        ListModel listModel = (ListModel)Model;
    <title>@listModel.Blog.Title</title>
    <meta name="description" content="@listModel.Blog.Description">
    }
    <link rel="alternate" type="application/rss+xml" title="@Model.Blog.Title" href="@absoluteUrl/feed/rss" />
}
@Html.Raw(Model.Blog.HeaderScript)